import django_filters
from django.db.models import Q

from apps.common.account.models import Account
from apps.pollution.models import Answer, CompanySelfAssessment


class AccountFilter(django_filters.rest_framework.FilterSet):
    username = django_filters.CharFilter(lookup_expr="icontains")

    class Meta:
        model = Account
        fields = ['username', ]


class AnswerFilter(django_filters.rest_framework.FilterSet):
    company_name = django_filters.CharFilter(lookup_expr="icontains")
    handler = django_filters.CharFilter(lookup_expr="icontains")

    class Meta:
        model = Answer
        fields = ['company_name', 'handler']


class CompanySelfAssFilter(django_filters.rest_framework.FilterSet):
    company_name = django_filters.CharFilter(lookup_expr="icontains")

    class Meta:
        model = CompanySelfAssessment
        fields = ['company_name', 'check_status']
